package top.faig.blog.common.controller;


import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.faig.blog.code.common.entity.Ip;
import top.faig.blog.common.service.IpService;

import java.util.List;

@RestController
@RequestMapping("/ip")
@RequiredArgsConstructor
public class IpController {

    private final IpService ipService;

    /**
     * @api {POST}  /article/add  添加博文
     * @apiGroup article
     * @apiSuccess {String} title 标题
     * @apiSuccess {String} context 内容
     * @apiSuccess {int} cateId 分类 ID
     * @apiSuccess {String} state 状态   {RELEASE: 发布，DRAFT: 草稿 (默认)，RECOVERY: 回收}
     */
    @PostMapping("/testing")
    public List<Ip> testing(@RequestBody Ip ip) {

        return ipService.testing(ip);
    }
}
